package com.ruoyi.web.controller.mqtt;

import org.springframework.integration.annotation.MessagingGateway;
import org.springframework.integration.mqtt.support.MqttHeaders;
import org.springframework.messaging.handler.annotation.Header;
import org.springframework.stereotype.Component;

import static com.ruoyi.web.controller.mqtt.MqttConfig.CHANNEL_NAME_OUT;


/**
 * @author hwf
 */
@Component
@MessagingGateway(defaultRequestChannel = CHANNEL_NAME_OUT)
public interface MqttSender {

    void sendToMqtt(String text);

    void sendWithTopic(@Header(MqttHeaders.TOPIC) String topic, String text);

    void sendWithTopicAndQos(@Header(MqttHeaders.TOPIC) String topic, @Header(MqttHeaders.QOS) Integer qos, String text);
}
